package edu.rit.drh4818.fire.colormap;

import java.awt.Color;

import edu.rit.drh4818.volume.Colormap;


/**
 * @author Darren Headrick
 *
 */
public class RedColormap extends Colormap
{
	public static String NAME = "Red"; 

	public RedColormap()
	{
		int gstep = 75, bstep = 150;
		int[] red = new int[ 256 ], blue = new int[ 256 ], green = new int[ 256 ];
		
		for( int x = 0; x < 256; x++ )
		{
			red[x] = Math.min(x*3, 255);
		}
		
		for( int x = gstep; x < green.length; x++ )
		{
			green[ x ] = red[ x - gstep ];
		}
		
		for( int x = bstep; x < blue.length; x++ )
		{
			blue[ x ] = red[ x - bstep ]; 
		}
		
		for( int x = 1; x < colorMapping.length-1; x++ )
		{
			colorMapping[255-x] = new Color( red[x], green[x], blue[x] ).getRGB();
		}
	}
	
	public String toString()
	{
		return NAME;
	}
}
